package org.gpslw.controller;

import org.gpslw.entity.NycHomicides;
import org.gpslw.service.NycHomicidesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/mybatis")
public class MybatisController {


    @Autowired
    private NycHomicidesService nycHomicidesService;

    /**
     * 使用mybatis-plus
     * @return
     */
    @GetMapping("/list")
    public List<NycHomicides> homicides() {
        List<NycHomicides> all = nycHomicidesService.list();
        return all;
    }
}
